package com.ruoyi.cms.service.impl;


import com.ruoyi.cms.domain.CmsCategory;
import com.ruoyi.cms.mapper.CmsCategoryMapper;
import com.ruoyi.cms.service.ICmsCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 分类Service业务层处理
 *
 * @author houyong
 * @date 2025-11-08
 */
@Service
public class CmsCategoryServiceImpl implements ICmsCategoryService {
    @Autowired
    private CmsCategoryMapper cmsCategoryMapper;

    /**
     * 查询分类
     *
     * @param id 分类主键
     * @return 分类
     */
    @Override
    public CmsCategory selectCmsCategoryById(String id) {
        return cmsCategoryMapper.selectCmsCategoryById(id);
    }

    /**
     * 查询分类列表
     *
     * @param cmsCategory 分类
     * @return 分类
     */
    @Override
    public List<CmsCategory> selectCmsCategoryList(CmsCategory cmsCategory) {
        return cmsCategoryMapper.selectCmsCategoryList(cmsCategory);
    }

    /**
     * 新增分类
     *
     * @param cmsCategory 分类
     * @return 结果
     */
    @Override
    public int insertCmsCategory(CmsCategory cmsCategory) {
        return cmsCategoryMapper.insertCmsCategory(cmsCategory);
    }

    /**
     * 修改分类
     *
     * @param cmsCategory 分类
     * @return 结果
     */
    @Override
    public int updateCmsCategory(CmsCategory cmsCategory) {
        return cmsCategoryMapper.updateCmsCategory(cmsCategory);
    }

    /**
     * 批量删除分类
     *
     * @param ids 需要删除的分类主键
     * @return 结果
     */
    @Override
    public int deleteCmsCategoryByIds(String[] ids) {
        return cmsCategoryMapper.deleteCmsCategoryByIds(ids);
    }

    /**
     * 删除分类信息
     *
     * @param id 分类主键
     * @return 结果
     */
    @Override
    public int deleteCmsCategoryById(String id) {
        return cmsCategoryMapper.deleteCmsCategoryById(id);
    }
}
